<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/18 0018
 * Time: 下午 6:15
 */
namespace app\article\validate;
class ValiCm {
    const errmsg=[
        'content.require'           =>10020,#评论不能为空
        'from_userid.require'       =>10021,#请登录后评论
        'from_userid.checkUserID'   =>10032,#用户不存在
        'compose_id.require'        =>10011,#请登录后评论
        'compose_id.checkCmId'      =>10011,#缺少参数
    ];

    /**
     * 发表评论
     * @return array
     */
    static function cm_add(){
        $rule =[
            'content'=>'require',
            'from_userid'=>'require'
        ];
        $message =self::errmsg;
        return ['rule'=>$rule,'message'=>$message];
    }

    /**
     * 删除评论
     * @return array
     */
    static function cm_del(){
        $rule =[
            'id'=>'require'
        ];
        $message =self::errmsg;
        return ['rule'=>$rule,'message'=>$message];
    }

    public static function myCm_list(){
        $rule =[
            'from_userid'=>'require|checkUserID'
        ];
        $message =self::errmsg;
        return ['rule'=>$rule,'message'=>$message];
    }
}